package com.cskaoyan.javase._1interface._4example.model;

/**
 * 商品类/实体类
 *
 * @since 11:37
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Goods {
    // id是唯一性标识
    private int id;
    private String name;
    private String brand;
    private double price;

    public Goods(int id, String name, String brand, double price) {
        this.id = id;
        this.name = name;
        this.brand = brand;
        this.price = price;
    }

    // 打印商品信息的方法
    public void printInfo() {
        System.out.println("id为" + id + "的商品,它的品牌是" + brand + ",商品名是" + name + ",它的价格是" + price);
    }

    public int getId() {
        return id;
    }
}
